<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head><title>TravelDream</title>
	<link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'/>
</h:head>
<body>
	
	<h:outputStylesheet library="css" name="primefaces-style2.css"/>


	<p:panel header="Admin Console">
		<h:panelGrid columns="10" cellpadding="3">
			<h:link outcome="homePage" value="Admin Console"/>
			
			 <h:link outcome="createTravelPackage" value="new package" />  
			  
			  <h:link outcome="newFlight" value="new flight"/>
			  
			  <h:link outcome="newHotel" value="new hotel"/> 
			  
			  <h:link outcome="newExcursion" value="new excursion"/>
			  
			  <h:link outcome="showAllPackages" value="show all packages"/>
			 
			  <h:link outcome="showAllHotels" value="show All Hotels"/> 
			   
			  <h:link outcome="showAllFlights" value="show All flights"/>
			   
			  <h:link outcome="showExcursion" value="show excursions"/> 
			  
			  <h:link outcome="manageCity" value="manage city"/>
			  
	 
			  <h:form>
				<p:commandButton id="logoutButton" value="logout" action="#{logout.logout()}"/>
			</h:form>
		</h:panelGrid>
	</p:panel>
	
	
	<div id="result">
	<p:panel header="All Travel Packages" rendered="#{!searchPackages.edit and !searchPackages.item}">
	
		<h:form >
			<p:dataTable id="resultDataTable" var="TravelDreamDTO"
				value="#{searchPackages.result}" styleClass="small-filter">
				
				<p:column headerText="Id" filterBy="id" filterMatchMode="contains">
					<h:outputText value="#{TravelDreamDTO.id}" />
				</p:column>
				<p:column headerText="Name" filterBy="packageName" filterMatchMode="contains">
					<h:outputText value="#{TravelDreamDTO.packageName}" />
				</p:column>

				<p:column headerText="Desc" filterBy="description" filterMatchMode="contains">
					<h:outputText value="#{TravelDreamDTO.description}" />
				</p:column>
				<p:column headerText="city" filterBy="city" filterMatchMode="contains">
					<h:outputText value="#{TravelDreamDTO.city}" />
				</p:column>

				<p:column headerText="Key1" filterBy="keyWord1" filterMatchMode="contains">
					<h:outputText value="#{TravelDreamDTO.keyWord1}" />
				</p:column>

				<p:column headerText="Key2" filterBy="keyWord2" filterMatchMode="contains">
					<h:outputText value="#{TravelDreamDTO.keyWord2}" />
				</p:column>

				<p:column headerText="Key3" filterBy="keyWord3" filterMatchMode="contains">
					<h:outputText value="#{TravelDreamDTO.keyWord3}" />
				</p:column>

				<p:column headerText="Person" filterBy="numberOfPerson" filterMatchMode="contains">
					<h:outputText value="#{TravelDreamDTO.numberOfPerson}" />
				</p:column>
				
				<p:column headerText="NumberOfNights" filterBy="numberOfNights" filterMatchMode="contains">
					<h:outputText value="#{TravelDreamDTO.numberOfNights}" />
				</p:column>
				

				<p:column headerText="">
					<p:commandButton value="edit"
						action="#{searchPackages.edit(TravelDreamDTO)}"  ajax="false"/>
				</p:column>

				<p:column headerText="">
					<p:commandButton value="Delete"
						action="#{searchPackages.delete(TravelDreamDTO)}" ajax="false" />
				</p:column>

				<p:column headerText="">
					<p:commandButton value="Items"
						action="#{searchPackages.showItems(TravelDreamDTO)}"  ajax="false"/>
				</p:column>
			</p:dataTable>
		</h:form>
</p:panel>
	</div>
	
		
	<div id="selectedPack">
	<p:panel header="Selected Package" rendered="#{searchPackages.item}">
	
		<h:form >
			<p:dataTable id="SelectedPackage" var="TravelDreamDTO"
				value="#{searchPackages.selectedPackage}">
				
				<p:column headerText="Id">
					<h:outputText value="#{TravelDreamDTO.id}" />
				</p:column>
				<p:column headerText="Name" >
					<h:outputText value="#{TravelDreamDTO.packageName}" />
				</p:column>

				<p:column headerText="Desc" >
					<h:outputText value="#{TravelDreamDTO.description}" />
				</p:column>
				<p:column headerText="city">
					<h:outputText value="#{TravelDreamDTO.city}" />
				</p:column>

				<p:column headerText="Key1" >
					<h:outputText value="#{TravelDreamDTO.keyWord1}" />
				</p:column>

				<p:column headerText="Key2">
					<h:outputText value="#{TravelDreamDTO.keyWord2}" />
				</p:column>

				<p:column headerText="Key3" >
					<h:outputText value="#{TravelDreamDTO.keyWord3}" />
				</p:column>

				<p:column headerText="Person" >
					<h:outputText value="#{TravelDreamDTO.numberOfPerson}" />
				</p:column>
				
				<p:column headerText="NumberOfNights" >
					<h:outputText value="#{TravelDreamDTO.numberOfNights}" />
				</p:column>
				
			</p:dataTable>
		</h:form>
</p:panel>
	</div>
		<h:form>
	<p:panel header="Error" rendered="#{searchPackages.errorFlight}" styleClass="error-header">
		<h:outputText value="#{searchPackages.errorRemoveFlight}" />
		<p:commandButton value="ok" action="#{searchPackages.okError()}" ajax="false"/>
	</p:panel>
	</h:form>
	<h:form>
	<p:panel header="Error" rendered="#{searchPackages.errorExcursion}" styleClass="error-header">
		<h:outputText value="#{searchPackages.errorRemoveExcursion}" />
		<p:commandButton value="ok" action="#{searchPackages.okError()}" ajax="false"/>
	</p:panel>
	</h:form>
	<h:form>
	<p:panel header="Error" rendered="#{searchPackages.errorHotel}" styleClass="error-header">
		<h:outputText value="#{searchPackages.errorRemoveHotel}" />
		<p:commandButton value="ok" action="#{searchPackages.okError()}" ajax="false"/>
	</p:panel>
	</h:form>
	

	<div id="edit">
		<p:panel header="Edit Package" rendered="#{searchPackages.edit}">
		<h:form id="editForm" >
			<h:panelGrid columns="3" cellpadding="3">
		
			<h:outputText value="Id" />
			<h:outputText value="#{searchPackages.selectedPackage.id}" />
			<h:outputText value="" />
			
			<h:outputText value="Package Name" />
			<p:inputText value="#{searchPackages.selectedPackage.packageName}" />
			<h:outputText value="" />
			
			<h:outputText value="Description" />
			<p:inputTextarea rows="8" cols="40" value="#{searchPackages.selectedPackage.description}" />
			<h:outputText value="" />
			
			<h:outputText value="Key1" />
			<p:inputText value="#{searchPackages.selectedPackage.keyWord1}" />
			<h:outputText value="" />
			
			<h:outputText value="Key2" />
			<p:inputText value="#{searchPackages.selectedPackage.keyWord2}" />
			<h:outputText value="" />
			
			<h:outputText value="Key3" />
			<p:inputText value="#{searchPackages.selectedPackage.keyWord3}" />
			<h:outputText value="" />
			
			<h:outputText value="Number of Person" />
			<p:inputText value="#{searchPackages.selectedPackage.numberOfPerson}" />
			<h:outputText value="" />
			
			<h:outputText value="From" /> 
     		<p:calendar value="#{searchPackages.selectedPackage.arrivo}" pattern="MM/dd/yyyy HH:mm" />
     		<h:outputText value="" />
     	
     		<h:outputText value="Nights" /> 
     		<p:inputText value="#{searchPackages.selectedPackage.numberOfNights}" />
     		<h:outputText value="" />

			
			<p:commandButton value="edit" action="#{searchPackages.saveEdit()}" ajax="false" />
			<p:commandButton value="cancel" action="#{searchPackages.cancel()}" ajax="false"/>
			
		</h:panelGrid>
		</h:form>
		</p:panel>
		

	</div>
	
		<p:panel header="Package flights" rendered="#{searchPackages.item}" styleClass="blue-header">
		
		
			<h:form id="flightRelated" >  
		    	<p:dataTable id="resultDataTableFlight" var="FlightDTO" value="#{searchPackages.flightDTOs}">  
		    	
			       <p:column headerText="Id">  
			            <h:outputText value="#{FlightDTO.id}" />  
			       </p:column>  
			     
			      <p:column headerText="ArrivalCity">  
			            <h:outputText value="#{FlightDTO.arrivalCity}" />  
			        </p:column>  
			  
			      <p:column headerText="DepartureCity">  
			            <h:outputText value="#{FlightDTO.departureCity}" />  
			        </p:column>  
			        
			 		 <p:column headerText="Data">  
			            <h:outputText value="#{FlightDTO.data}" />  
			        </p:column>
			        
			        <p:column headerText="Price(EUR)">  
			            <h:outputText value="#{FlightDTO.price}" />  
			        </p:column>
			        
			        <p:column headerText="">  
			        <p:commandButton value="Remove" action="#{searchPackages.removePackageFlight(FlightDTO)}" 
			        ajax="false">
			         </p:commandButton>
			        
			        </p:column>
			     		  
    	</p:dataTable>  
    	   
	</h:form>
	</p:panel>
	
	
	  
	
	 
		
		<p:panel header="Package Hotels" rendered="#{searchPackages.item}" styleClass="orange-header">
			
		<h:form id="showHotelForm" >  
		    	<p:dataTable id="resultDataTableHotel" var="HotelDTO" value="#{searchPackages.hotelDTOs}">  
		    	 
			       <p:column headerText="Id">  
			            <h:outputText value="#{HotelDTO.id}" />  
			       </p:column>  
			     
			      <p:column headerText="Description">  
			            <h:outputText value="#{HotelDTO.description}" />  
			        </p:column>  
			  
			      <p:column headerText="name">  
			            <h:outputText value="#{HotelDTO.name}" />  
			        </p:column>  
			        
			        <p:column headerText="City">  
			            <h:outputText value="#{HotelDTO.city}" />  
			        </p:column>
			        
			 		 <p:column headerText="Address">  
			            <h:outputText value="#{HotelDTO.address}" />  
			        </p:column>
			        
			         <p:column headerText="stars">  
			           <p:rating value="#{HotelDTO.stars}" readonly="true"/>  
			        </p:column>
			        
			        <p:column headerText="Price(EUR)">  
			            <h:outputText value="#{HotelDTO.price}" />  
			        </p:column>

			        
			         <p:column headerText="">  
			        <p:commandButton value="Remove" action="#{searchPackages.removePackageHotel(HotelDTO)}"
			        ajax="false">
			        </p:commandButton>
			        </p:column>
    	</p:dataTable>  
    	
	</h:form>
	</p:panel>

	 
	 
	<p:panel header="Package Excursions" rendered="#{searchPackages.item}" styleClass="green-header">
	
			<h:form id="excursionRelated" >  
		    	<p:dataTable id="resultDataTableExcursion" var="ExcursionDTO" value="#{searchPackages.excursionDTOs}">  
		    	 
			       <p:column headerText="Id">  
			            <h:outputText value="#{ExcursionDTO.id}" />  
			       </p:column>  
			     
			      <p:column headerText="name">  
			            <h:outputText value="#{ExcursionDTO.name}" />  
			        </p:column>  
			  
			      <p:column headerText="desc">  
			            <h:outputText value="#{ExcursionDTO.description}" />  
			        </p:column>  
			        
			 		 <p:column headerText="price(EUR)">  
			            <h:outputText value="#{ExcursionDTO.price}" />  
			        </p:column>
			        
			        <p:column headerText="">  
			        <p:commandButton value="Remove" action="#{searchPackages.removePackageExcursion(ExcursionDTO)}"
			        ajax="false">
			        </p:commandButton>
			        </p:column>		  
    	</p:dataTable>  
    	   
	</h:form>
</p:panel>

	
	<div class="space">
	
	</div>
	
	<div class="separationLine">
	</div>
	
	<div class="space">
	
	</div>
	
	<p:panel header="Possible Flight To Add" rendered="#{searchPackages.item}" styleClass="blue-header">
	

	<h:form id="possibleFlightToAdd" >  
		    	<p:dataTable id="flightToAdd" var="FlightDTO" value="#{searchPackages.possibleFlightList}">  
		    	 <f:facet name="header">  
          				  	  
       					 </f:facet> 
			       <p:column headerText="Id">  
			            <h:outputText value="#{FlightDTO.id}" />  
			       </p:column>  
			     
			      <p:column headerText="ArrivalCity">  
			            <h:outputText value="#{FlightDTO.arrivalCity}" />  
			        </p:column>  
			  
			      <p:column headerText="DepartureCity">  
			            <h:outputText value="#{FlightDTO.departureCity}" />  
			        </p:column>  
			        
			 		 <p:column headerText="Data">  
			            <h:outputText value="#{FlightDTO.data}" />  
			        </p:column>
			        
			        
			        <p:column headerText="Price(EUR)">  
			            <h:outputText value="#{FlightDTO.price}" />  
			        </p:column>
			        
			        
			          <p:column headerText="">  
			        <p:commandButton value="add" action="#{searchPackages.addFlight(FlightDTO)}"
			       ajax="false" >
			       
			       </p:commandButton>
			        </p:column>
	       
    	</p:dataTable>  
    	   
	</h:form>  
		</p:panel>

	
		<p:panel header="Possible Hotel To Add" rendered="#{searchPackages.item}" styleClass="orange-header">
		
	
		<h:form id="possibleHotelToAdd" >  
		    	<p:dataTable id="hotelToAdd" var="HotelDTO" value="#{searchPackages.possibleHotelList}">  
		    	 <f:facet name="header">  
          				  	 
       					 </f:facet> 
			       <p:column headerText="Id">  
			            <h:outputText value="#{HotelDTO.id}" />  
			       </p:column>  
			     
			      <p:column headerText="Description">  
			            <h:outputText value="#{HotelDTO.description}" />  
			        </p:column>  
			  
			      <p:column headerText="Name">  
			            <h:outputText value="#{HotelDTO.name}" />  
			        </p:column>  
			        
			        <p:column headerText="City">  
			            <h:outputText value="#{HotelDTO.city}" />  
			        </p:column>  
			        
			 		 <p:column headerText="Address">  
			            <h:outputText value="#{HotelDTO.address}" />  
			        </p:column>
			        
			        <p:column headerText="stars">  
			           <p:rating value="#{HotelDTO.stars}" readonly="true"/>  
			        </p:column>
			        <p:column headerText="Price(EUR)">  
			            <h:outputText value="#{HotelDTO.price}" />  
			        </p:column>
			 
			  <p:column headerText="">  
			        <p:commandButton value="add" action="#{searchPackages.addHotel(HotelDTO)}"
			        ajax="false"/>
			      </p:column>
			 
		        
    	</p:dataTable>  
	</h:form> 
		</p:panel>
			
	<p:panel header="Possible Excursions to Add"  rendered="#{searchPackages.item}" styleClass="green-header">
	
			<h:form id="possibleExcursionToAdd">  
		    	<p:dataTable id="excursionToAdd" var="ExcursionDTO" value="#{searchPackages.possibleExcursionList}">  
		    	<f:facet name="header">  
          				  	  
       					 </f:facet> 
			       <p:column headerText="Id">  
			            <h:outputText value="#{ExcursionDTO.id}" />  
			       </p:column>  
			     
			      <p:column headerText="name">  
			            <h:outputText value="#{ExcursionDTO.name}" />  
			        </p:column>  
			  
			      <p:column headerText="desc">  
			            <h:outputText value="#{ExcursionDTO.description}" />  
			        </p:column>  
			        
			 		 <p:column headerText="price">  
			            <h:outputText value="#{ExcursionDTO.price}" />  
			        </p:column>
			        
			        <p:column headerText="">  
			        <p:commandButton value="Add" action="#{searchPackages.addExcursion(ExcursionDTO)}"
			        ajax="false">
			        </p:commandButton>
			        </p:column>
			 
		        
    	</p:dataTable>  
	</h:form> 
	</p:panel>
		
	
	
	
	

</body>
</html>
